<?php 
class indexmodel extends model{
public function indexlist(){
$sql="select * from liuyanban";
return $this->db->query($sql);
}
public function del($id){
	$sql="delete from liuyanban where id={$id}";
	
	return $this->db->exec($sql);
}
public function update($id){
	$sql="select * from liuyanban where id=$id";
	return $this->db->query($sql);
}
public function up($id,$zuozhe,$title,$content){
	$sql="update liuyanban set zuozhe='$zuozhe',title='$title',content='$content' where id=$id";
    return $this->db->exec($sql);
}
public function addy($title,$content,$zuozhe,$time){
	$sql="insert into liuyanban(title,content,zuozhe,time) values('$title','$content','$zuozhe',$time)";
	// var_dump($sql);die;
	return $this->db->exec($sql);
}

}


 ?>